#include <iostream>
using namespace std;

/*
    【题目212】定义一个国家基类Country，包含国名、首都、人口等属性，派生出省类Province，增加省会城市、人口数量属性。
*/

class Country
{
public:
    Country(string countryName, string capital, int population)
    {
        this->countryName = countryName;
        this->capital = capital;
        this->population = population;
    }
    void showCountry()
    {
        cout << "countryName: " << countryName << endl;
        cout << "capital: " << capital << endl;
        cout << "population: " << population << endl;
    }

private:
    string countryName;
    string capital;
    int population;
};

class Province : public Country
{
public:
    Province(string countryName, string capital, int population, string provinceName, string capitalCity, int populationNum) : Country(countryName, capital, population)
    {
        this->provinceName = provinceName;
        this->capitalCity = capitalCity;
        this->populationNum = populationNum;
    }
    void showProvince()
    {
        cout << "provinceName: " << provinceName << endl;
        cout << "capitalCity: " << capitalCity << endl;
        cout << "populationNum: " << populationNum << endl;
    }

private:
    string provinceName;
    string capitalCity;
    int populationNum;
};

int main()
{
    Province p("China", "Beijing", 1400000000, "Shanxi", "Taiyuan", 35000000);
    p.showCountry();
    p.showProvince();
    return 0;
}